﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessObjects.BO_GetObjects;
using System.Data;

public partial class Controls_Servey : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            loadData();
        }
    }

    protected void loadData()
    {
        //DataTable objDT = BO_portal_survey_questions.SelectWithPaged(1, 1, 1);
        //if (objDT.Rows.Count > 0)
        //{
        //    strQuestion.InnerText = objDT.Rows[0]["QUESTION_TEXT"].ToString();
        //    hdfID.Value = objDT.Rows[0]["QUESTION_ID"].ToString();
        //    objDT = BO_portal_survey_answers.SelectAllByQuestion(1, Convert.ToInt32(objDT.Rows[0]["QUESTION_ID"]));
        //    rptControl.DataSource = objDT;
        //    rptControl.DataBind();
        //}
    }

    protected string getControl(string control_name, string id)
    {
        if (control_name.Equals("Textbox"))
        {
            return "<input type=\"text\" name=\"radio\" class=\"radio\" />";
        }
        else if (control_name.Equals("Radio Buttons"))
        {
            return "<input type=\"radio\" name=\"radio\" class=\"radio\" title=\"" + id + "\" />";
        }
        else if (control_name.Equals("Checkbox"))
        {
            return "<input type=\"checkbox\" name=\"radio\" class=\"radio\" />";
        }
        else if (control_name.Equals("TextArea"))
        {
            return "<textarea name=\"radio\" class=\"radio\"></textarea>";
        }
        else if (control_name.Equals("Combobox"))
        {
            return "<input type=\"select\" name=\"radio\" class=\"radio\" />";
        }
        return "";
    }
}